package com.pr.makfilm.user.pages.room.create.preview;

import com.google.common.collect.Table;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;

/**
 * Created with IntelliJ IDEA.
 * User: Pawel
 * Date: 09.10.13
 * Time: 17:44
 * To change this template use File | Settings | File Templates.
 */
public class PreviewRow extends Panel
{
   private IModel<Table> placesModel;

   private int rowId;

   private String header;

   private PreviewCellRepeater cellRepeater;

   public PreviewRow(String id, IModel<?> roomModel, IModel<Table> placesModel, int rowId, String header)
   {
      super(id, roomModel);
      this.placesModel = placesModel;
      this.rowId = rowId;
      this.header = header;
   }

   @Override
   protected void onInitialize()
   {
      super.onInitialize();
      add(new Label("header", header));
      add(cellRepeater = new PreviewCellRepeater("cells", getDefaultModel(), placesModel, rowId));
   }
}
